package cn.gok.hotelback.service.impl;

import cn.gok.hotelback.entity.RoomType;
import cn.gok.hotelback.mapper.RoomTypeMapper;
import cn.gok.hotelback.service.RoomTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class RoomTypeServiceImpl implements RoomTypeService {
    @Autowired
    private RoomTypeMapper roomTypeMapper;

    @Override
    public List<RoomType> getAllRoomTypes() {
        return roomTypeMapper.selectAll();
    }
    
    @Override
    public float getPriceByTypeId(Integer typeId) {
        RoomType roomType = roomTypeMapper.selectById(typeId);
        return roomType != null ? roomType.getPricePerNight() : 0.0f;
    }

    @Override
    public RoomType getRoomTypeById(Integer typeId) {
        return roomTypeMapper.selectById(typeId);
    }
} 